package org.apache.dubbo.demo.consumer.comp;

import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.demo.GreetingService;
import org.apache.dubbo.rpc.service.GenericService;
import org.springframework.stereotype.Component;

/**
 * @author duyutian
 * @version 1.0
 * @date 2020/8/19 17:57
 */
@Component("genericServiceComponent")
public class MyGenericServiceComponent {

    @Reference(interfaceName = "org.apache.dubbo.demo.GreetingService",generic = true)
    private GreetingService myGenericService;

    public void d1(){
        //泛化调用
        System.out.println(((GenericService)myGenericService).$invoke("d1",null,null));
    }
}
